package com.dbh.company.buildbook;

import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.http.HttpRequest;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @author dongbanghui
 * @create 2023/11/6
 */
public class Digtalhuman {

    public static void main(String[] args) {
        List<String> idList = FileUtil.readLines("D:\\data\\work\\file\\楼书\\楼书1.0\\楼书&数字人\\id.txt", "UTF-8");
//          List<String> idList = FileUtil.readLines("D:\\data\\work\\file\\楼书\\楼书1.0\\楼书&数字人\\projectNum.txt", "UTF-8");
        for (String id : idList) {
//            router(id);
            generateVideo(Convert.toLong(id));
            ThreadUtil.sleep(1000 * 30);
        }


    }

    private static void generateVideo(Long id) {
        String url = "http://backend-mr.ke.com/v1/dDigtalhuman/create";
        String body = HttpRequest.post(url)
                .header("Cookie", "crosSdkDT2019DeviceId=-uudqok-p0z6tw-u5tozzmsej9s39l-t6zeqcw9i; ketest-env=production; _ga=GA1.2.2121015128.1686129466; wx_device_id=bUTx-Zs85VX-EJ38i6V8ZKBFvZtdlNd_7n7X1cq3OrE=; ke_uuid=f975736ecd03071f59f4d5c22f49dd01; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%22ce301845-8fe2-4a00-96fb-8f5ac09fbf35%22%2C%22first_id%22%3A%2218976818cbd94a-066522c3f35ba78-7e565470-2073600-18976818cbe2427%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E8%87%AA%E7%84%B6%E6%90%9C%E7%B4%A2%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC%22%2C%22%24latest_referrer%22%3A%22https%3A%2F%2Fcn.bing.com%2F%22%7D%2C%22%24device_id%22%3A%2218976818cbd94a-066522c3f35ba78-7e565470-2073600-18976818cbe2427%22%7D; lianjia_token=2.00142ef58481bf11a905874b3666eb973d; lianjia_uuid=50c64720-fd66-41f2-bf05-5eb735c23187; login_ucid=1000000029138498; ketest-session=ue6fk1207x8v79iln2uwtpyhh11inamz; ketest-user=eyJsb2dpbl91c2VyIjogIjEwMDAwMDAwMjkxMzg0OTgiLCAiYWNjb3VudCI6ICJkb25nYmFuZ2h1aTAwMSIsICJhY2NvdW50U3lzdGVtSWQiOiAiZW1wbG95ZWUiLCAiYXZhdGFyIjogIm51bGwiLCAiYmlydGhkYXkiOiAibnVsbCIsICJidXNpbmVzc1Rva2VuIjogIjIuMDExMWE5YmViMjg0Mzg1YTlmMDAwMWNiNTQ4NDBmZWQwMmJiZTU4NWM0IiwgImNvcnBJZCI6ICJudWxsIiwgImRpc3BsYXlOYW1lIjogIlx1ODQ2M1x1NWUyZVx1OGY4OSIsICJlbWFpbCI6ICJkb25nYmFuZ2h1aTAwMUBrZS5jb20iLCAiZ2VuZGVyIjogIk1BTEUiLCAiaWQiOiAiMTAwMDAwMDAyOTEzODQ5OCIsICJtZmFBdXRoTWV0aG9kTGV2ZWwiOiAiMCIsICJwYXNzZWRNZmFSZWFzb24iOiAiaXBXaGl0ZUxpc3QiLCAicGhvbmUiOiAiMTg1MDE5OTI1OTQiLCAicmVhbE5hbWUiOiAiXHU4NDYzXHU1ZTJlXHU4Zjg5IiwgInNlcnZpY2VJZCI6ICJ4bWVuLmludHJhLmtlLmNvbSIsICJzdGF0ZSI6ICJOT1JNQUwiLCAidGd0SWQiOiAiVEdULTEyMTIwNzktSTJGRllnWjNmNFhvcW9qOWY3LU8wb3FjSWVULVJrNmJUYkZGanRVT2tRQVdvRjZwb21rdVJiQjZkaGhicjFLOEx5Yy1rZS5jb20iLCAidWNpZCI6ICIxMDAwMDAwMDI5MTM4NDk4IiwgInVjbmFtZSI6ICJcdTg0NjNcdTVlMmVcdThmODkiLCAidWlkIjogIjEwMDAwMDAwMjkxMzg0OTgiLCAidXNlcl9jb2RlIjogIjI5MTM4NDk4IiwgInVzZXJUYWciOiAiMCIsICJ2ZXJzaW9uIjogIjg4OCIsICJ6aGlkYW9fdWNpZCI6ICIyMTEwMDAwMDA0MDk2ODA5IiwgIm5leHRfdXJsIjogImh0dHA6Ly9rZXRlc3QtcHJvLmtlLmNvbS8jL3Rvb2wvZGF5dUNoYXRib3QifQ=a2V0ZXN0LXVzZXI==; _gid=GA1.2.1135035892.1700622876; mr_backend_service_uid=1000000029138498; security_ticket_test=TfZgGg3HsGp6aAv4Vhn4cqZ9h7wvedoUEgHsDaxHCFped/QoQxr40gHz7Hk7dteun/E1V+asSFRxW/kuP+XBgUi+ozVOctThPc/f/pZpmXlZMrl5eu8L54vuwxTjJG5lVLQz5Qrloe0jiPUoP6u3sMPwCEyTbZuJtmB6FG47Ukw=; _ga_F0DQ6TTSVW=GS1.2.1700654483.55.1.1700654678.60.0.0; lianjia_ssid=a2f3ef43-5d43-4ecb-a6c2-15b750584eed; security_ticket=pvMMo/Ve+HSkXCoeowt8F+TxiXonFqQO/4njQnVDgGshWIXWFHpESjBVAVV1HQeRFq2BsWH/sp7DRnZ8xI88IOq+d0E2ACcHbo/AUNclhzoLhUJ8eLoLVXQG+BA6ol99ri3TScreaujJH5ciiJejbShJ+WqKFrcR3P2rNk0dJA0=; casgwusercred=JeB0aqScXfnBqHHKMTc-uOGE18GJEkyUiXFoQzMHOViUwaIx3XvCvh7ljAjvPXrrE9FjxVsi9Ki18Ktqm3Jj6FiXxkTkKjQ1rWJ6_zGpylq7k_DuGi68OgD6i4R_zbIAaY3H3XtR0Nu04Dfxu_o0EpHkjORaA1qH5ybgiLkK8fw; crosgwusercred=P9_5unP3MN3GId8ENxx3RRnkjRrNJ_V-PnKvR2P1OHE059Fsbo9-jdyXJgfUk4fr_htiXoowVLL_GPmAN_x1Bgf331a7b0a3a9580b362bbcb61ed30559; factory_token=2.0111a9beb284385a9f0001cb542fb85e495d01483a; mr_backend_login_user=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzZXNzaW9uSWQiOiIyLjAwMTNmNWVkNDA4NjY0MDk2ZDAyNWM1M2YyNDZmNTU1MGIifQ.OKPs4_Gr4osvYEqb6iLYZUdSkSRxpY87QXeu9uY4wqk")
                .form("id", id)
                .execute()
                .body();

        Console.log("输入参数:{}, 返回结果：{}", id, body);
    }

    private static void router(String projectNum) {
        String url = "https://pre-mr.ke.com/api/project/router?projectNum=" + projectNum;
        String body = HttpRequest.get(url)
                .execute()
                .body();
        Console.log("返回结果：{}", body);
    }



}
